import {
  Column,
  CreateDateColumn,
  Entity,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { FavoriteTypes } from '../dtos/favorite.dto';

@Entity('tb_favorite', {
  comment: '收藏表',
})
export abstract class Favorite {
  @PrimaryGeneratedColumn('increment', { comment: '自增主键', unsigned: true })
  id: number;

  @Column({ comment: '用户ID' })
  userId: number;

  @Column({ comment: '收藏类型' })
  type: FavoriteTypes;

  @Column({ comment: '资源ID' })
  resourceId: number;

  @CreateDateColumn({ comment: '收藏时间' })
  time: Date;
}
